<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">

		<title>验证邮箱</title>

		<link href="/static/user/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css">
		<link href="/static/user/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css">

		<link href="/static/user/css/personal.css" rel="stylesheet" type="text/css">
		<link href="/static/user/css/stepstyle.css" rel="stylesheet" type="text/css">


		<script type="text/javascript" src="/static/user/js/jquery-1.7.2.min.js"></script>
		<script src="/static/user/AmazeUI-2.4.2/assets/js/amazeui.js"></script>

		<script>
			function Mailcheck(){
				let usermail = document.getElementById('umail');
				let btn = document.getElementById('sendcode');
				//msg.style.display = 'none';
				let model = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$");
				if(model.test(usermail.value)){
					btn.classList.remove('am-disabled');
				}else{
					//msg.style.display = 'block';
					b.style.display = 'none';
				}
			}

			let t;
			let num = 30;
			function run(){
				if(num<0){
					let btn  =document.getElementById('sendcode');
					btn.classList.remove('am-disabled');
					btn.value = '发送验证码';
					clearTimeout(t);
					num = 30;
					return false;
				}
				$("#sendcode").val(`${num}s后重发`);
				--num;
				t=setTimeout("run()",1000)
			}
			function email()
			{
				let b = $("#umail").val();
				let btn = document.getElementById('sendcode');
				btn.classList.add('am-disabled');
				clearInterval(t);
				run();
				
				
				$.ajax({
					url:"/user/User/sendemail",
					type:"post",
					dataType:"html",
					data:{toemail:b},
					success:function(data)
					{
					},
					error:function()
					{
					}
				})
			}			



		</script>
	</head>

	<body>
		<!--头 -->
		<header>
			<article>
				<div class="mt-logo">
					<!--顶部导航条 -->
					<div class="am-container header">
						<ul class="message-r">
							<div class="topMessage home">
								<div class="menu-hd"><a href="/" target="_top" class="h">商城首页</a></div>
							</div>
							<div class="topMessage my-shangcheng">
								<div class="menu-hd MyShangcheng"><a href="/person" target="_top"><i class="am-icon-user am-icon-fw"></i>个人中心</a></div>
							</div>
							<div class="topMessage mini-cart">
								<div class="menu-hd"><a id="mc-menu-hd" href="#" target="_top"><i class="am-icon-shopping-cart  am-icon-fw"></i><span>购物车</span><strong id="J_MiniCartNum" class="h">0</strong></a></div>
							</div>
							<div class="topMessage favorite">
								<div class="menu-hd"><a href="/user/user/logout" target="_top"><i class="am-icon-power-off am-icon-fw"></i><span>退出</span></a></div>
							</div>
							</ul>
						</div>

						<!--悬浮搜索框-->

						<div class="nav white">
							<div class="logoBig">
								<a href="/"><img src="/static/user/images/guangonglogo.jpg"/></a>
							</div>

							<div class="search-bar pr">
								<a name="index_none_header_sysc" href="#"></a>
								<form action="/user/index/search" method="GET">
									<input id="searchInput" name="name" type="text" placeholder="搜索" autocomplete="off">
									<input id="ai-topsearch" class="submit am-btn" value="搜索" index="1" type="submit">
								</form>
							</div>
						</div>

						<div class="clear"></div>
					</div>
				</div>
			</article>
		</header>

			<b class="line"></b>
		<div class="center">
			<div class="col-main">
				<div class="main-wrap">

					<div class="am-cf am-padding">
						<div class="am-fl am-cf"><strong class="am-text-danger am-text-lg">绑定邮箱</strong> / <small>Email</small></div>
					</div>
					<hr/>
					<!--进度条-->
					<div class="m-progress">
						<div class="m-progress-list">
							<span class="step-1 step">
                                <em class="u-progress-stage-bg"></em>
                                <i class="u-stage-icon-inner">1<em class="bg"></em></i>
                                <p class="stage-name">验证邮箱</p>
                            </span>
							<span class="step-2 step">
                                <em class="u-progress-stage-bg"></em>
                                <i class="u-stage-icon-inner">2<em class="bg"></em></i>
                                <p class="stage-name">完成</p>
                            </span>
							<span class="u-progress-placeholder"></span>
						</div>
						<div class="u-progress-bar total-steps-2">
							<div class="u-progress-bar-inner"></div>
						</div>
					</div>
					<form action="/user/Person/setemail" method="POST" class="am-form am-form-horizontal">
						<div class="am-form-group">
							<label for="user-email" class="am-form-label">验证邮箱</label>
							<div class="am-form-content">
								<input type="email" name="umail" id="umail" placeholder="请输入邮箱地址" onblur="Mailcheck()">
							</div>
						</div>
						<div class="am-form-group code">
							<label for="user-code" id="Code" class="am-form-label">验证码</label>
							<div class="am-form-content">
								<input type="tel" name="Code" id="user-code" placeholder="请输入验证码">
							</div>
							<a class="btn" href="javascript:void(0);" onclick="sendMobileCode();" id="sendMobileCode">
							<input type="button" id="sendcode" class="am-btn am-btn-danger btn-loading-example am-disabled" data-am-loading = '60s后可重新发送' onclick="email()" value="发送验证码">
							</a>
						</div>
						<div class="info-btn">
								<input type="submit"  value="确认修改" class="am-btn am-btn-danger">
							</div>

					</form>

				</div>
				<!--底部-->
				<div class="footer">
					<div class="footer-hd">
						<p>
							<a href="/">商城首页</a>
							<b>|</b>
							<a href="https://www.alipay.com/">支付宝</a>
							<b>|</b>
							<a href="https://www.kuaidi100.com/?from=openv">快递查询</a>
						</p>
					</div>
				</div>
			</div>

			<aside class="menu">
				<ul>
					<li class="person">
						<a href="/person">个人中心</a>
					</li>
					<li class="person">
						<a>个人资料</a>
						<ul>
							<li> <a href="/information">个人信息</a></li>
							<li class="active"> <a href="/safety">安全设置</a></li>
							<li> <a href="/address">收货地址</a></li>
						</ul>
					</li>
					<li class="person">
						<a>我的交易</a>
						<ul>
							<li><a href="/order?act1=1">订单管理</a></li>
						</ul>
					</li>


					<li class="person">
						<a>我的小窝</a>
						<ul>
							<li> <a href="/comment">评价</a></li>
						</ul>
					</li>

				</ul>

			</aside>
		</div>

	</body>

</html>